Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Enable UAP Remote Execution for all tests #21014

Merged
merged 1 commit into from
Jun 14, 2017

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Jun 13, 2017

This change to enable remote execution of all corefx tests in UAP. Because the remote execution code for UAP is using WinRT APIs and to avoid forcing adding UAP configuration to all test projects, we factor the remote execution code into its own test library (called TestHelper) which is cross compiled.

@tarekgh tarekgh added * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) area-Infrastructure-libraries labels Jun 13, 2017
@tarekgh
Copy link
Member Author

tarekgh commented Jun 13, 2017

@weshaggard @ericstj could you please have a look? this is refactoring the remote execution code to be in its own library to avoid adding UAP configuration to all test projects.

@tarekgh
Copy link
Member Author

tarekgh commented Jun 13, 2017

CC @stephentoub @joperezr @safern @danmosemsft

@tarekgh
Copy link
Member Author

tarekgh commented Jun 13, 2017

Note that, I'll not merge the changes here till we get Helix uses RS2 OS images. so this PR is kind of blocked by that.

@tarekgh
Copy link
Member Author

tarekgh commented Jun 13, 2017

@mmitche OSX legs failed because of out of disk space. I am not sure why portable Linux failed. do you know why?

@mmitche
Copy link
Member

mmitche commented Jun 13, 2017

FYI @dotnet/eng-first

@dotnet-bot test Innerloop OSX10.12 Debug x64 Build and Test
@dotnet-bot test Innerloop OSX10.12 Release x64 Build and Test

Not sure why the portable build failed. The line at the end is "script returned -1". https://ci3.dot.net/blue/organizations/jenkins/dotnet_corefx%2Fmaster%2Fportable-linux-Config_Debug%2BOuterLoop_false_prtest/detail/portable-linux-Config_Debug%20OuterLoop_false_prtest/863/pipeline

I wonder whether the build crashed.

@mmitche
Copy link
Member

mmitche commented Jun 13, 2017

@dotnet-bot test Portable Linux x64 Debug Build

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a more descriptive name than TestHelper we could use? CoreFx.TestUtilities or something along those lines?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weshaggard @ericstj what you think of naming this library? I agree with @stephentoub to have better name as TestHelper is more generic. Having CoreFX in the name can give idea it is corefx specific library.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @stephentoub as well. CoreFx.TestUtilties is fine by me. As we had discussed before you could consider using Private or Internal in the name if you wanted to discourage its use by product assemblies.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect that we will put other test stuff in here like PlatformDetection and our custom Asserts? We should actually consider doing that now that we have a test helper library here.

As for a name I don't know if we need the name CoreFX included as I don't know that it buys us much, but I do wonder if we shouldn't have it under the Common folder so it doesn't look like a shipping library.

Copy link
Member Author

@tarekgh tarekgh Jun 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to focus on the remote execution so I would to keep the changes in this PR to the remote execution only and we can later move more test code as PlatformDetection there.

I kept the test library folder with other libraries per @ericstj recommendation. so I am not sure if we have to move it to the common folder? please advise if I should do that.

for naming I'll go with CoreFX.Private.TestUtlities. let me know if you disagree with this name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to focus on the remote execution so I would to keep the changes in this PR to the remote execution only and we can later move more test code to PlatformDetection there.

Sounds good.

I kept the test library folder with other libraries per @ericstj recommendation. so I am not sure if we have to move it to the common folder? please advise if I should do that.

Given that it has a ref and other configurations keeping it here is probably easier, lets do that for now and see if any issues arise.

for naming I'll go with CoreFX.Private.TestUtlities. let me know if you disagree with this name.

That is fine, but I think you want CoreFx.Private.TestUtilities

namespace System.Diagnostics
{
/// <summary>Base class used for all tests that need to spawn a remote process.</summary>
public abstract partial class RemoteExecutorTestBase : FileCleanupTestBase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume none of this code has changed, so I'm not re-reviewing it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I didn't change any code logic. I had to change some internal specifiers to be public specifier instead.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this.

Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @tarekgh

@@ -0,0 +1,127 @@
// Licensed to the .NET Foundation under one or more agreements.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look like it was generated by GenAPI. Any reason not to have it generated so we can easily regenerate in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You caught it :-) I'll regenerate using GenAPI

<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyKey>MSFT</AssemblyKey>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't use the MSFT Key. For this please use the Test key.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also probably use 1.0.0.0 as the assembly version, just because it is different from our shipping libraries.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix those


<ItemGroup Condition="'$(TargetGroup)' == 'uap'">
<Reference Include="Windows" />
<Reference Include="WindowsBase" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does WindowsBase need to be referenced?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove WindowsBase. will try that.

@@ -0,0 +1,66 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would name this file something like ".process" instead of "nouap", to better call out what it is doing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to name the files with the targetGroup id's. but I don't have any objection to rename it as you suggested.

@@ -114,7 +114,7 @@
Condition="'$(TargetGroup)'=='uap'" >

<PropertyGroup>
<UAPToolsPackageVersion>1.0.2</UAPToolsPackageVersion>
<UAPToolsPackageVersion>1.0.4</UAPToolsPackageVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you will need to merge with @joperezr's changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I'll merge with @joperezr changes after his PR merge

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, we already talked about this, we will have to create a new version entirely for his changes to work, so we will rebase this PR once mine is merged.

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to focus on the remote execution so I would to keep the changes in this PR to the remote execution only and we can later move more test code to PlatformDetection there.

Sounds good.

I kept the test library folder with other libraries per @ericstj recommendation. so I am not sure if we have to move it to the common folder? please advise if I should do that.

Given that it has a ref and other configurations keeping it here is probably easier, lets do that for now and see if any issues arise.

for naming I'll go with CoreFX.Private.TestUtlities. let me know if you disagree with this name.

That is fine, but I think you want CoreFx.Private.TestUtilities

/// <summary>Base class used for all tests that need to spawn a remote process.</summary>
public abstract partial class RemoteExecutorTestBase : FileCleanupTestBase
{
protected static readonly string HostRunnerExecutableName = "dotnet";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is further clean-up of what was already there it doesn't look like HostRunnerExecutableName and HostRunnerName are even used anywhere so they can just be deleted. In which case HostRunner is all that is needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HostRunnerName is used in the S.D.Process tests. but I'll look at the ones not used outside here and will remove them.

/// <summary>Base class used for all tests that need to spawn a remote process.</summary>
public abstract partial class RemoteExecutorTestBase : FileCleanupTestBase
{
protected static readonly string HostRunnerExecutableName = "xunit.runner.uap";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like any of these Host fields are used in the uap case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept it because it is used in other test code like S.D.Process tests. as I mentioned in other comment I'll try to get rid of the fields not used in the test projects

@joperezr
Copy link
Member

@tarekgh I've merged my PR so you should be able to rebase this and merge it in now.

This change to enable remote execution of all corefx tests in UAP. Because the remote execution code for UAP is using WinRT APIs and to avoid forcing adding UAP configuration to all test projects, we factor the remote execution code into its own test library (called TestHelper) which is cross compiled.
@tarekgh tarekgh force-pushed the EnableRemoteExecutorForAllTests branch from 4d03638 to 412bdb6 Compare June 14, 2017 19:28
@tarekgh tarekgh removed the * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Jun 14, 2017
@tarekgh tarekgh merged commit eb2f543 into dotnet:master Jun 14, 2017
@tarekgh
Copy link
Member Author

tarekgh commented Jun 14, 2017

Thanks all for your review and comments.

@tarekgh tarekgh deleted the EnableRemoteExecutorForAllTests branch May 25, 2018 17:24
macrogreg pushed a commit to open-telemetry/opentelemetry-dotnet-instrumentation that referenced this pull request Sep 24, 2020
This change to enable remote execution of all corefx tests in UAP. Because the remote execution code for UAP is using WinRT APIs and to avoid forcing adding UAP configuration to all test projects, we factor the remote execution code into its own test library (called TestHelper) which is cross compiled.

Commit migrated from dotnet/corefx@eb2f543
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants